package com.zsrt.java.day20161227.wrl.demo01;

import org.junit.Test;

public class RandomDemo {
	
	/**
	 * 1.首先把11个人放进去
	 * 2.随机random floor 取出来
	 * @throws Exception
	 */
	@Test
	public void random01() throws Exception {
		String[] class1612 = new String[11];
			class1612[0] = "张泽谋";
			class1612[1] = "吴荣来";
			class1612[2] = "钟鹏";
			class1612[3] = "刘浩";
			class1612[4] = "谢文威";
			class1612[5] = "黄志杰";
			class1612[6] = "张志东";
			class1612[7] = "胡斌";
			class1612[8] = "陈皋";
			class1612[9] = "曾少华";
			class1612[10] = "林天杰";
		
		//Math.random() : 返回 0.0<=number<1.0 的随机数
		double ran = Math.random();
		System.out.println(ran);
		double len = ran*class1612.length;
		System.out.println(len);
		
		System.out.println("------------------------------");
		double aa = 0.5545453;
		System.out.println(aa);
		
		//去尾
		double f  = Math.floor(aa);
		
		//进一
		double c  = Math.ceil(aa);
		System.out.println(f);
		System.out.println(c);
	}
}
